package com.yyge.web.servlet;

import com.yyge.dao.Impl.UserInfoDaoImpl;
import com.yyge.entity.Userinfo;
import com.yyge.util.ServletUtil;
import com.yyge.vo.R;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 用户全查
 */
@WebServlet("/select/")
public class UserInfoSelectServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        UserInfoDaoImpl userInfoDao=new UserInfoDaoImpl();
        List<Userinfo> all = userInfoDao.findAll();
        R ok = R.ok(all);
        System.out.println(all);
        ServletUtil.writeResult2Client(resp,ok);
    }

}
